home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmPassword
- BorderStyle = 1 'Fixed Single
- Caption = "Password protection"
- ClientHeight = 1830
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 4215
- ControlBox = 0 'False
- Icon = "frmPassword.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1830
- ScaleWidth = 4215
- StartUpPosition = 1 'CenterOwner
- Begin VB.CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "&Cancel"
- Height = 375
- Left = 2970
- TabIndex = 2
- Top = 600
- Width = 1095
- End
- Begin VB.CommandButton cmdOk
- Caption = "&OK"
- Height = 375
- Left = 2970
- TabIndex = 1
- Top = 150
- Width = 1095
- End
- Begin VB.TextBox txtPassword
- Height = 285
- IMEMode = 3 'DISABLE
- Left = 120
- MaxLength = 80
- PasswordChar = "*"
- TabIndex = 0
- Top = 480
- Width = 2655
- End
- Begin VB.Label lblPasswordExplanation
- Height = 615
- Left = 120
- TabIndex = 4
- Top = 960
- Width = 2535
- End
- Begin VB.Label lblPassword
- Caption = "Enter a password:"
- Height = 255
- Left = 120
- TabIndex = 3
- Top = 120
- Width = 2655
- End
- Attribute VB_Name = "frmPassword"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- '=========================================================================
- ' Description: The frmPassword form is used for prompting the user to
- ' enter a password. If no passwords is given by the user, the
- ' zip file's content will not be encrypted.
- '=========================================================================
- '------------------------------------------------------------------------------------
- ' Shows the Password dialog
- '------------------------------------------------------------------------------------
- Public Function ShowForm(xZip As XceedZip) As Boolean
- frmPassword.Tag = "0"
- ' Displays a text to explain how entering a password
- ' will affect the zip file.
- lblPasswordExplanation.Caption = "Enter a password above to protect " + _
- "files from being unzipped without " + _
- "first entering this same password."
- ' Loads xZip's Password property to the "txtPassword" textbox.
- frmPassword.txtPassword.Text = xZip.EncryptionPassword
- ' Shows the form
- frmPassword.Show vbModal
- ' If tag = "1" then the user clicked on Ok and the password
- ' value is copied in the xZip property
- If frmPassword.Tag = "1" Then
- xZip.EncryptionPassword = txtPassword.Text
- End If
- ShowForm = (frmPassword.Tag = "1")
- End Function
- Private Sub cmdCancel_Click()
- Me.Hide
- End Sub
- Private Sub cmdOk_Click()
- Me.Tag = "1"
- Me.Hide
- End Sub
-